package today.rocky.pattern.factory.simplefactory;

import today.rocky.pattern.factory.common.Cestbon;
import today.rocky.pattern.factory.common.Water;

/**
 * @version 1.0
 * @vlog:
 * @description:
 * @author: Rocky
 * @createDate: 2020/7/27 23:41
 */
public class SimpleFactoryTest {
	public static void main(String[] args) {
		//测试名字
		SimpleWaterFactory factory1 = new SimpleWaterFactory();
		Water water1 = factory1.getWater("nongfu");
		water1.drink();

		//测试反射
		SimpleWaterFactory factory2 = new SimpleWaterFactory();
		Water water2 = factory2.getWater(Cestbon.class);
		water2.drink();



	}
}
